pub mod queue;
///静态帮助类
pub mod util;
///透传暴露的lib
pub use chrono;
///命令行模块
pub use clap;
///日志模块
pub use fern;
///like git's ignore logic
pub use ignore;
pub use log;
pub use zip;
pub use md5;
pub use lazy_static;

#[test]
fn test_libs() {
    use crate::util::filesys::zip_dir;
    use ignore::{DirEntry, Error, WalkBuilder};
    use log::{debug, info};
    use std::path::Path;
    use std::{env, fs};

    fn ignore_zipfile() -> Result<(), Error> {
        let cur = env::current_dir()?;
        let src_dir = cur.join("test");
        let tar_f = src_dir.join("out.zip");
        println!("cur path {:?}", src_dir);
        let zipfile = std::fs::File::create(&tar_f).unwrap();
        let mut ws2 = WalkBuilder::new(&src_dir);
        let ret = &mut ws2.build().into_iter().filter_map(|v| {
            println!("find file->{:?}", v.clone().unwrap().path().display());
            return v.ok();
        });
        let zip_f = zip_dir(ret, src_dir.to_str().unwrap(), zipfile);
        if zip_f.is_err() {
            fs::remove_file(&tar_f.as_path());
        }
        Ok(())
    }
}
